package edu.scau.mis.dashboard.mapper;

import edu.scau.mis.dashboard.dto.CategorySalesDTO;
import edu.scau.mis.dashboard.dto.MonthSalesDTO;
import edu.scau.mis.dashboard.vo.PieDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@Mapper
public interface SaleItemMapper {
    // 获取所有有销售记录的年份
    List<Integer> selectDistinctSalesYears();

    // 获取指定年份各月销售数据
    List<MonthSalesDTO> selectMonthlySalesByYear(Integer year);

    // 获取指定日期范围内各分类销售额
    List<CategorySalesDTO> selectTopAmount(
            @Param("startDate") LocalDate startDate,
            @Param("endDate") LocalDate endDate
    );
    // 获取指定日期范围内各分类销售量
    List<PieDataVo> selectTopQuantity(
            @Param("startDate") LocalDate startDate,
            @Param("endDate") LocalDate endDate
    );

}
